<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>

<body>
    <div id="app">
       <!-- {{ message | currency:"￥" }}-->
       <ul>
           <!--过滤器，从第二个开始取，取2个,vue2.0中好像此方法已废弃-->
           <li v-for="item in fruits | limitBy 2">{{item}}</li>
       </ul>

       <ul>
            <!--过滤器，过滤含a的选项,vue2.0中好像此方法已废弃-->
            <li v-for="item in fruits | filterBy a">{{item}}</li>
        </ul>
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                a:'o',
                message: 'runoob',
                fruits:['pear','apple','banana','orange','watermelon'],
            },
            filters: {
                //{{message}}作为参数
                capitalize: function (value) {
                    if (!value) return ''
                    value = value.toString()
                    //首字母大写
                    return value.charAt(0).toUpperCase() + value.slice(1)
                },
            }
        })
    </script>
</body>

</html>